import request from "@/sheep/request";

export default {
  //员工考勤设置数据
  getConfig: (params) =>
    request({
      url: "api/attendance_record/config",
      method: "GET",
      params,
      custom: {
        showLoading: false,
        loadingMsg: "加载中",
        showError: true,
        showSuccess: false,
        errorMsg: "",
        auth: true,
        successMsg: false,
      },
    }),

  // 获取当天考勤记录
  getTodayAttendancw: (params) =>
    request({
      url: "api/attendance_record/get_today_attendancw",
      method: "GET",
      params,
      custom: {
        showLoading: false,
        loadingMsg: "加载中",
        showError: true,
        showSuccess: false,
        errorMsg: "",
        auth: true,
        successMsg: false,
      },
    }),

  //打卡、补卡提交
  postClockin: (params) =>
    request({
      url: "api/attendance_record/clockin",
      method: "GET",
      params,
      custom: {
        showLoading: true,
        loadingMsg: "加载中",
        showError: true,
        showSuccess: false,
        errorMsg: "",
        auth: true,
        successMsg: false,
      },
    }),

  //员工考勤统计日
  getAttendanceDay: (data) =>
    request({
      url: "api/attendance_record/statistics_day",
      method: "GET",
      custom: {
        auth: true,
      },
      data,
    }),
  //员工考勤统计周
  getAttendanceweek: (params) =>
    request({
      url: "api/attendance_record/statistics_week",
      method: "GET",
      custom: {
        auth: true,
      },
      params,
    }),
  //员工考勤统计月
  getAttendanceMonth: (params) =>
    request({
      url: "api/attendance_record/statistics_month",
      method: "GET",
      custom: {
        auth: true,
      },
      params,
    }),
  //   获取某月考勤统计状态,
  getAttendanceMonthStatus: (params) =>
    request({
      url: "api/attendance_record/get_month_status",
      method: "GET",
      custom: {
        auth: true,
      },
      params,
    }),
};
